<#assign tit>选择会员卡号</#assign>
<@page.html title=tit>
<script type="text/javascript">
  function selOk() {
    var i, vv = null;
    var cbs = document.getElementsByName("sel");
    if(!cbs || cbs.length==0) {
      window.alert("没有可选卡号");
      return false;
    }
    for(i=0; i<cbs.length; i++) {
      if(cbs[i].checked) {
        vv = cbs[i].value;
        break;
      }
    }
    if(!vv) {
      window.alert("请选择卡号");
      return false;
    }

    if(window.parent && window.parent.selCardOk)
      window.parent.selCardOk(vv);
    cancel();
  }
  function cancel() {
    if(window.parent && window.parent.closeWin)
      window.parent.closeWin();
    else
      window.close();
  }
  function trsel(tr) {
    tr.cells[0].firstChild.checked = true;
  }
</script>
<div style="">

  <div>
    <table class="list">
      <tr>
        <th width="10%">选择</th>
        <th width="35%">卡号</th>
        <th width="25%">配卡日期</th>
        <th width="30%">状态</th>
      </tr>
    </table>
    <div style="height:274px; overflow-y:auto;">
      <table class="list">
        <#if list??><#list list as c>
        <tr<#if c_index%2==1> class="line2"<#else> class="line1"</#if> onclick="trsel(this);">
          <td width="10%" class="no"><input type="radio" name="sel" value="${c.cardCode!}" /></td>
          <td width="35%">${c.cardCode!}</td>
          <td width="30%">${c.createTime!}</td>
          <td width="25%">可用</td>
        </tr></#list></#if>
      </table>
    </div>
  </div>
  <div class="button" style="margin:10px 10px 5px;"><input type="button" value="确定" onclick="selOk();"><input type="button" value="取消" onclick="cancel();"></div>
  <div style="margin:5px 10px 0;"><#if lstp??><#list lstp as c>${c.cardType!}卡: ${c.status!}张 </#list></#if></div>
</div>
</@page.html>